<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/css/combo.select.min.css">
    <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
    <script src="/js/jquery-select.min.js"></script>
</head>
<body>
<h2>使用本地数据渲染select</h2>
<label for="demo2">json数据渲染:</label>
<select name="" id="demo2" style="width: 150px"></select>
<script type="text/javascript">
    $(function () {
        var json = [{"id":"1","name":"sunyu","pinyin":"sy"},
            {"id":"2","name":"lisi","pinyin":"ls"},
            {"id":"3","name":"zhangsan","pinyin":"zs"},
            {"id":"4","name":"wangwu","pinyin":"ww"}];
        $("#demo2").select({
            localData:json,
            emptyMsg:'未找到查询结果',
            valueField:'id',
            textField:'name',
            placeholder:'==请选择==',
            pinyinField:'pinyin',
            onSelect:function(value,text){
                console.log("value:"+value);
                console.log("text:"+text);
                console.log($("#me2").val());
            }

        });
    });
</script>
</body>
</html>